package com.timothy.android;

import android.graphics.Color;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class HomeActivity extends BaseActivity {
	private TextView console = null;
	
	private Button disConnectBtn = null;
	private Button offlineVoteBtn = null;
    
    
    
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.home);
		
		super.mobileDefaultSetting();
		//set screen orientation to portrait
		//client component
		console = (TextView) this.findViewById(R.id.console);	
		console.setTextColor(Color.BLACK);
		console.setTextSize(15);
		console.setBackgroundColor(Color.parseColor("#ede26a"));
		
//		console.append("Connected to BaseStation :" + baseStationName  + "\n");
//		console.append("Address:" + hostAddr + " Port:" + port +"\n");
		console.append("Waiting Server Send Question..." + "\n");
		console.append("If you want to enter offline vote, click button 'Offline Vote'" + "\n");
		
		disConnectBtn = (Button) this.findViewById(R.id.disConnectBtn);
		offlineVoteBtn = (Button) this.findViewById(R.id.offlineVoteBtn);
		
		//click end Button
		disConnectBtn.setOnClickListener( mUnbindListener );
		offlineVoteBtn.setOnClickListener( offlineVoteListener );
	}
	
	private OnClickListener mUnbindListener = new OnClickListener() {
        public void onClick(View v) {
            doUnbindService();
        }
    }; 
    
    private OnClickListener offlineVoteListener = new OnClickListener() {
        public void onClick(View v) {
        	
        }
    };



	@Override
	protected void processMessage(int what, String content) {
		// TODO Auto-generated method stub
		
	}
}
